package com.celan.year2023.month05.day13;

import java.util.HashSet;

/**
 * @author Celan
 * @description: TODO
 */
class Solution {
    public int findMaxK(int[] nums) {
        int res = -1;
        HashSet<Integer> set = new HashSet<>();
        for (int num : nums) set.add(num);
        for (int i : set) {
            if (i > res && set.contains(-i)) res = i;
        }
        return res;
    }
}